import * as React from 'react'; import { SearchField, SearchFieldProps } from '@aws-amplify/ui-react'; import { useSearchFieldProps } from './useSearchFieldProps'; import { SearchFieldPropControls } from './SearchFieldPropControls'; import { Demo } from '@/components/Demo'; import { demoState } from '@/utils/demoState'; const propsToCode = (searchFieldProps) => { return ( `` ); }; const defaultSearchFieldProps = { hasSearchButton: true, hasSearchIcon: false, isDisabled: false, label: 'Search', labelHidden: true, placeholder: 'Search here...', size: null, variation: null, }; export const SearchFieldDemo = () => { const searchFieldProps = useSearchFieldProps( (demoState.get(SearchField.displayName) as SearchFieldProps) || defaultSearchFieldProps ); const onSubmit = React.useCallback( (value) => alert(`you searched for ${value}`), [] ); return ( } > ); };